home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.0 KB | 88 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: SLPriMem.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef SLPRIMEM_H
- #define SLPRIMEM_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #include <stddef.h>
-
- // Export or Import functions for CFM-68K [sfu]
-
- #if defined(FW_ODFLIB_IMPORT)
- #pragma import on
- #elif defined(FW_ODFLIB)
- #pragma export on
- #endif
-
- extern "C"
- {
-
- //----------------------------------------------------------------------------------------
- // Primitive Memory Operations
- //
- // These functions provide a platform-independent interface to low level operating
- // system services for memory management. The functions impose minimal requirements
- // on the underlying environment, and are built in the simplest way on top of native
- // operating system APIs. Requirements for parameter validation and error handling
- // are minimal: it is the clients responsiblity to provide valid parameters!
- //
- // Memory blocks allocated and freed by these functions can be as large as can be
- // requested with a size_t parameter, but these routines should generally not be
- // used for large allocations.
- //
- // This function are intended for use by very low-level code. Applications, Component
- // Editors (and most of ODF) should use higher level interfaces.
- //
- //----------------------------------------------------------------------------------------
-
- void * FW_PrimitiveAllocateBlock(size_t bytesRequested);
- // Operation is undefined for bytesRequested == 0
- // Operation is also undefined if a signed negative value is passed in for bytesRequested.
- // Returns 0 if request could not be satisfied due to insufficient memory.
-
- void * FW_PrimitiveResizeBlock(void *block, size_t bytesRequested);
- // The block may be moved to satisfy request.
- // Returns 0 if request could not be satisfied.
- // Resize of NULL or invalid block is undefined (platform-dependent).
-
- void FW_PrimitiveFreeBlock(void *block);
- // Free of invalid block is undefined (platform-dependent).
- // It is a no-op to try to free NULL.
-
- size_t FW_PrimitiveGetBlockSize(void* p);
- // Returns size in bytes.
- // Size of NULL or invalid block is undefined (platform-dependent).
-
- void FW_PrimitiveCopyMemory(const void *source, void *destination, size_t bytes);
- // Copy from source to destination.
- // Source and destination may be overlapping.
- // No error detection provided, i.e. it is assumed that both the source and destination
- // buffers are at least 'bytes' long.
-
- void FW_PrimitiveSetMemory(void* block, size_t bytes, unsigned char value);
- // Sets every byte of the block to value
- // No error detection provided, i.e. it is assumed that block is at least 'bytes' long.
-
- // FW_EXTERN_C_END
- }
-
- // For CFM-68K [sfu]
-
- #if defined(FW_ODFLIB_IMPORT)
- #pragma import off
- #elif defined(FW_ODFLIB)
- #pragma export off
- #endif
-
- #endif
-